package com.mz.ozy.mvp.model;

import android.content.Context;

import com.mz.ozy.constants.Constants;
import com.mz.ozy.net.RetrofitUtils;
import com.mz.ozy.utils.JsonUtils;

import java.util.HashMap;
import java.util.Map;

import io.reactivex.Observable;
import okhttp3.ResponseBody;

/**
 * Created by administrator on 2018/12/4.
 */
public class CodeModel {

    /**
     * @param context
     * @param mobilePhone 手机号
     * @param type        业务类型
     * @return
     */
    public Observable<ResponseBody> onGetCode(Context context, String mobilePhone, String type) {
        Map<String, String> map = new HashMap<>();
        map.put("username", mobilePhone);
        map.put("actionType", type);
        map.put("t", Constants.tokenId);
        return RetrofitUtils.getApiService(context).post(Constants.TransCode.TransCode10001, JsonUtils.requestJsonDate(map), null);
    }
}
